package design.pattern.decorator;

/**
 * @author AtoVio, Winter Yuan
 */
public class Client {
    public static void main(String[] args) {
        // 来一份炒饭
        FastFood rice = new FriedRice();
        System.out.printf("一份 %s ，花费 %4.2f 元\n", rice.getDesc(), rice.cost());

        System.out.println("====================");

        // 加一个鸡蛋
        rice = new Egg(rice);
        System.out.printf("一份 %s ，花费 %4.2f 元\n", rice.getDesc(), rice.cost());

        System.out.println("====================");

        // 加一份培根
        rice = new Bacon(rice);
        System.out.printf("一份 %s ，花费 %4.2f 元\n", rice.getDesc(), rice.cost());
    }
}
